#include <bits/stdc++.h>
using namespace std;
const int maxn=205,mod=1e9+7;
int mo(int x){x>mod?x-mod:x;}
int n,k,ans=0;
char a[maxn],now[maxn],lnow[maxn];
bool check(int l,int r,bool in)
{
	stack<int> S;
	int flag=-1,fist,len=0,cnt=0;
	for(int i=l;i<=r;i++)
	{
		if(now[i]=='(')
			S.push(i);
		else if(now[i]==')')
		{
			if(S.size()==1)
				if(!check(S.top()+1,i-1,1))return 0;
				else 
				{
					if(flag==-1)fist=0;
					flag=0;
					cnt++;
				}
			len=0;
			S.pop();
		}
		if(S.empty()&&now[i]=='*')
		{
			if(len==0)
			{
				if(flag==-1)fist=1;
					flag=1;
				cnt++;
			}
			len=1;
		}
	}
	if(cnt<=1)return 1;
	if(!in&&(flag||fist))return 0;
	if(in&&(flag&&fist))return 0;
	return 1;
}
void searchs(int step,int bra,int len,bool ap)
{
	
	if(step==n+1)
	{
		if(bra==0&&len==0&&check(1,n,0))
		{
			ans++,ans=mo(ans);
		}
		return;
	}
	char p=a[step];
	if(p=='('||p=='?')
		now[step]='(',searchs(step+1,bra+1,0,1);
	if(p==')'||p=='?')
		if(bra>0)now[step]=')',searchs(step+1,bra-1,0,1);
	if(p=='*'||p=='?')
		if(ap&&len+1<=k)now[step]='*',searchs(step+1,bra,len+1,1);
}
int main()
{
	freopen("bracket.in","r",stdin);
	freopen("bracket.out","w",stdout);
	scanf("%d%d",&n,&k);
	scanf("%s",a+1);
	searchs(1,0,0,0);
	printf("%d\n",ans);
}
